<tagLib name="html" />

<include file="Public:header" />

<div class="container" id="cpcontainer">
    <div class="itemtitle">
        <h3>{$Think.lang.tag.manage_tag}</h3>
        <ul class="tab1">
            <li><a href="__URL__/searchTag"><span>{$Think.lang.tag.search_tag}</span></a></li>
            <li><a href="__URL__/addTag"><span>{$Think.lang.tag.add_tag}</span></a></li>
            <li class="current"><a href="__URL__/tagList"><span>{$Think.lang.tag.all_tag}</span></a></li>
        </ul>
    </div>
    <p class="tips">{$Think.lang.tag.manage_tag_tips}</p>
    <p class="tips"><input type="button" class="btn" value="{$Think.lang.tag.sync_tag}" onclick="syncTag();" /></p>
    <form name="cpform" method="post" action="__URL__/manageTag" id="cpform">
    <input type="hidden" name="op" value="save" />
    <table class="tb tb2 fixpadding tablesorter" id="myTable">
        <thead>
        <tr>
            <th></th>
            <th width="25%">{$Think.lang.tag.tag_name}</th>
            <th>{$Think.lang.tag.tagged_question_count}</th>
            <th>{$Think.lang.tag.tag_status}</th>
            <th>{$Think.lang.actions}</th>
            <th width="10%">{$Think.lang.mark}</th>
        </tr>
        </thead>
        <tbody>
        <notempty name="tagList">
        <volist name="tagList" id="vo">
        <tr>
            <td>&nbsp;</td>
            <td><a href="{$vo.tag_id|format_tag_url=$vo['name']}" target="_blank" title="{$vo.description}">{$vo.name}</a></td>
            <td>{$vo.question_count}</td>
            <td><eq name="vo.status" value="1">{$Think.lang.open}<else/><b>{$Think.lang.locked}</b></eq></td>
            <td><a class="act" href="__URL__/editTag/tag_id/{$vo.tag_id}">{$Think.lang.edit}</a></td>
            <td><input type="checkbox" class="checkbox" name="mods[]" value="{$vo.tag_id}" /></td>
        </tr>
        </volist>
        <else/>
        <tr><td colspan="6" align="center">{$Think.lang.no_record}</td><tr>
        </notempty>
        </tbody>
        <tr class="nobg">
            <td colspan="5">
                <div class="cuspages left"><div class="pages">{$pagination}</div></div>
                <div class="fixsel right">
                    <input type="submit" class="btn" name="action[open]" value="{$Think.lang.tag.open_tag}" /> &nbsp;
                    <input type="submit" class="btn" name="action[lock]" value="{$Think.lang.tag.lock_tag}" /> &nbsp;
                    <input type="submit" class="btn" name="action[delete]" value="{$Think.lang.tag.del_tag}" /> &nbsp;
                </div>
            </td>
            <td width="10%"><input type="checkbox" name="chkall" id="chkall" class="checkbox" onclick="checkAll('prefix', this.form, 'mods')" /><label for="chkall">{$Think.lang.check_all}</label></td>
        </tr>
    </table>
    </form>
</div>

<script type="text/javascript">
$(function(){
    $("#myTable").tablesorter({
        headers:{
            0:{sorter:false},
            4:{sorter:false},
            5:{sorter:false},
        }
    });
});

function syncTag(){
    window.location.href = '__URL__/syncTag';
}
</script>

<include file="Public:footer" />
